package com.dream.bean;

import javax.validation.constraints.Pattern;

import org.hibernate.validator.constraints.Email;

public class Employee {
    private Integer empId;

    @Pattern(regexp="^[\u4e00-\u9fa5]{2,5}$",message="姓名必须是2-5位的中文")
    private String empName;

    private String empSex;

    @Email(message="邮箱格式不正确")
    private String empEmail;

    private Integer deptId;
    
    private Department department;
    
    public Employee() {
		super();
		// TODO Auto-generated constructor stub
	}

	public Employee(Integer empId, String empName, String empSex,
			String empEmail, Integer deptId) {
		super();
		this.empId = empId;
		this.empName = empName;
		this.empSex = empSex;
		this.empEmail = empEmail;
		this.deptId = deptId;
	}


	public Integer getEmpId() {
        return empId;
    }

    public void setEmpId(Integer empId) {
        this.empId = empId;
    }

    public String getEmpName() {
        return empName;
    }

    public void setEmpName(String empName) {
        this.empName = empName == null ? null : empName.trim();
    }

    public String getEmpSex() {
        return empSex;
    }

    public void setEmpSex(String empSex) {
        this.empSex = empSex == null ? null : empSex.trim();
    }

    public String getEmpEmail() {
        return empEmail;
    }

    public void setEmpEmail(String empEmail) {
        this.empEmail = empEmail == null ? null : empEmail.trim();
    }


	public Integer getDeptId() {
		return deptId;
	}

	public void setDeptId(Integer deptId) {
		this.deptId = deptId;
	}

	public Department getDepartment() {
		return department;
	}

	public void setDepartment(Department department) {
		this.department = department;
	}

	@Override
	public String toString() {
		return "Employee [empId=" + empId + ", empName=" + empName
				+ ", empSex=" + empSex + ", empEmail=" + empEmail + ", deptId="
				+ deptId + ", department=" + department + "]";
	}

}